using System;

namespace Quiki.ElementFormatters
{
    public class DocumentGraphBuilder
    {
        public DocumentGraphBuilder()
        {
            graph = new DocumentGraph();
        }

        public DocumentGraphBuilder(DocumentGraph graph)
        {
            this.graph = graph;
        }

        public DocumentGraph Graph
        {
            get { return graph; }
        }

        public DocumentGraphBuilder AddDocumentWithCategories(string documentName, params string[] categories)
        {
            WikiDocument doc = new WikiDocument(new WikiDocReference(documentName), documentName);
            doc.Categories.AddMany(categories);
            graph.AddDocument(doc);
            return this;
        }

        public void AddDocument(WikiDocument document)
        {
            graph.AddDocument(document);
        }

        private readonly DocumentGraph graph;
    }
}